<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>待处理事项</title>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/css/styles.css">
</head>
<body>
    <div class="records-container">
        <div class="tabs" style="margin: 20px 0;">
            <button class="btn ${lb!=1 ? "btn-secondary": " "}" onclick="location.href='<%=request.getContextPath()%>/pend/PendingServlet?zt=申请&&lb=1'">用车申请</button>
            <button class="btn ${lb!=2 ? "btn-secondary": " "}" onclick="location.href='<%=request.getContextPath()%>/pend/PendingServlet?zt=申请&&lb=2'">事故报告</button>
            <button class="btn ${lb!=3 ? "btn-secondary": " "}" onclick="location.href='<%=request.getContextPath()%>/pend/PendingServlet?zt=还车登记&&lb=3'">还车登记</button>
        </div>
        <div class="table-responsive">
            <table class="table">
                <thead>

                    <tr>
                        <th>序号</th>
                        <th>申请人</th>
                        <th>车牌号</th>
                        <th>用途</th>
                        <c:if test="${lb==1}">
                            <th>开始时间</th>
                            <th>结束时间</th>
                        </c:if>
                        <c:if test="${lb==3}">
                            <th>结束历程</th>
                            <th>结束油量</th>
                        </c:if>

                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                <c:forEach items="${pingList}" var="ping" varStatus="p">
                    <tr>
                        <td>${p.index}</td>
                        <td>${ping.usernameid}</td>
                        <td>${ping.message}</td>
                        <td>${ping.shiyong}</td>
                        <c:if test="${lb==1}">
                            <td>${ping.stime}</td>
                            <td>${ping.otime}</td>
                        </c:if>
                        <c:if test="${lb==3}">
                            <td>${ping.okm}</td>
                            <td>${ping.oil}</td>
                        </c:if>
                        <td>
                            <button class="btn btn-small">同意</button>
                            <button class="btn btn-small btn-warning">拒绝</button>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>
</body>
</html> 